<{include file=$module.'/header.php'}>
<div class="page add-comment" id="page-app-add-comment">
	<header class="bar bar-nav common-bar-nav">
		<a class="pull-left back"><i class="fa fa-arrow-left"></i></a>
		<h1 class="title">个人资料</h1>
		<a class="pull-right external" href="/<{$routeUrl}>/pwd">修改密码</a>
	</header>
	<{include file=$module.'/nav.php'}>
	<div class="content">
		<div class="list-block m-t-1">
			<ul>
				<li class="item-content item-link">
					<div class="item-inner">
						<div class="item-title">UID</div>
						<div class="item-after"><{$admin.id}></div>
					</div>
				</li>
				<li class="item-content item-link">
					<div class="item-inner">
						<div class="item-title">身份</div>
						<div class="item-after"><{$userLevels[$admin.level]}></div>
					</div>
				</li>
				<li class="item-content item-link">
					<div class="item-inner">
						<div class="item-title">姓名</div>
						<div class="item-after"><{$admin.realname}></div>
					</div>
				</li>
				<li>
					<a id="sex-actions" class="item-content item-link">
						<div class="item-inner">
							<div class="item-title">性别</div>
							<div class="item-after"><span id="sex"><{$sexRadio[$admin.sex]}></span></div>
						</div>
					</a>
				</li>
				<li class="item-content item-link">
					<div class="item-inner">
						<div class="item-title">手机</div>
						<div class="item-after"><{$admin.tel}></div>
					</div>
				</li>
				<!-- <li class="item-content item-link">
					<div class="item-inner">
						<div class="item-title">到期时间</div>
						<div class="item-after"><{$user.end_time}></div>
					</div>
				</li> -->
			</ul>
		</div>
		
		<div class="content-padded">
			<a href="javascript:;" class="button button-fill button-big button-danger submit-com" data-id="<{$info.id}>">退出登录</a>
		</div>
		</form>
	</div>
</div>

<script>
$(function(){

	$(document).on('click', '.submit-com', function(){
		$.toast('退出成功', "/<{$module}>/login/logout");
	})

	//性别修改
$(document).on("click","#sex-actions", function () {
  var buttons1 = [
    {
      text: '请选择',
      label: true
    },
    {
      text: '男性',
      bold: true,
      onClick: function() {

			$.post("/<{$routeUrl}>/<{$action}>", {do:'sex',sex:1}, function(response){
				if(response.code == 0){
					$.alert(response.msg);
					return;
				}
				if(response.code == 1){
					$.toast(response.msg,'/<{$routeUrl}>/setting');
				}
			});
     	}
    },
    {
      text: '女性',
      color: 'danger',
      onClick: function() {
			$.post("/<{$controller}>/<{$action}>", {do:'sex',sex:0}, function(response){
				if(response.code == 0){
					$.alert(response.msg);
					return;
				}
				if(response.code == 1){
					$.toast(response.msg,'/<{$routeUrl}>/setting');
				}
			});
    	}
    }
  ];
  var buttons2 = [
    {
      text: '取消',
      bg: 'danger'
    }
  ];
  var groups = [buttons1, buttons2];
  $.actions(groups);
}); 
});

</script>
<{include file=$module.'/footer.php'}>